package com.freesky.biz.icbc.controller;

import com.freesky.biz.icbc.domain.TWomenDay;
import com.freesky.biz.icbc.service.IAigouFridayService;
import com.freesky.biz.icbc.service.IWomenDayService;
import com.freesky.biz.pay.config.AliPayConfiguration;
import com.freesky.common.annotation.Log;
import com.freesky.common.core.controller.BaseController;
import com.freesky.common.core.domain.AjaxResult;
import com.freesky.common.core.page.TableDataInfo;
import com.freesky.common.enums.BusinessType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.util.List;

/**
 * 妇女节
 */
@RestController
@RequestMapping("/icbc/women")
public class WomenDayController extends BaseController {

    @Autowired
    private IWomenDayService womenDayService;

    @Autowired
    private AliPayConfiguration aliPayConfiguration;

    /**
     * 爱购星期五列表
     */
    @PreAuthorize("@ss.hasPermi('icbc:women:list')")
    @GetMapping("/list")
    public TableDataInfo list(TWomenDay womenDay) {
        //createDailyBill("2024-04-01","2024-04-30");
        //124400555
        startPage();
        List<TWomenDay> list = womenDayService.findList(womenDay);
        return getDataTable(list);
    }

    @Log(title = "妇女节", businessType = BusinessType.EXPORT)
    @PreAuthorize("@ss.hasPermi('icbc:women:export')")
    @GetMapping("/export")
    public AjaxResult export(TWomenDay womenDay,
                             HttpServletResponse response) {
        return womenDayService.exportFile(womenDay);
    }

}
